// +----------------------------------------------------------------------
// | Project:   Android-Commons  
// +----------------------------------------------------------------------
// | CreateTime: 15/12/14  下午5:50
// +----------------------------------------------------------------------
// | Author:     xab(xab@xabad.cn)
// +----------------------------------------------------------------------
// | Description:
// +----------------------------------------------------------------------
package cn.xabad.commons.converter;

import org.json.JSONException;

/**
 * DESC   :
 * AUTHOR : Xabad
 */
public abstract class XsonCallback extends StringCallback {

    @Override
    public void onSuccess(String s) {
        if (null != s && !"".equals(s)) {
            try {
                onSuccess(new XsonObject(s));
            } catch (JSONException e) {
                onFailure(e);
            }
        } else {
            onSuccess(new XsonObject());
        }
    }


    public abstract void onSuccess(XsonObject jsonObject);
}
